import { defineStore } from "pinia";

export const useHistorySearchParam = defineStore("historySearchParam", {
  state: () => ({
    historySearchParam: {} as any,
    tallyType: "ost"
  }),
  getters: {
    getHistorySearchParam: state => {
      return state.historySearchParam;
    }
  },
  actions: {
    setParam(param: any) {
      const that = this;
      that.historySearchParam = param;
    },
    setTallyType(type: string) {
      const that = this;
      that.tallyType = type;
    },
    removeParam() {
      const that = this;
      that.historySearchParam = {} as any;
    },
    resetTallyType() {
      const that = this;
      that.tallyType = "ost";
    }
  }
});
